package cn.lanqiao.bigDate.service.img;

import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.image.BufferedImage;
import java.util.Random;

import cn.lanqiao.common.identifyingCode.HeightCode;
import cn.lanqiao.common.identifyingCode.ImageUtils;
import org.springframework.stereotype.Service;




/**
 * Created by sunsharp on 2017/8/25.
 */
@Service
public class ImageService {
	public static final  Random R = new Random();
	public static final  int W=100;
	public static final  int H=40;
	/**
	 * 得到复杂验证码
	 * @param count 几位验证码
	 * @return
	 */
	public Captcha getImageHeigh(int count)throws Exception{
		String code= HeightCode.generateVerifyCode(count);

		//将
		BufferedImage bufferedImage= ImageUtils.getHeightImage(W,H,code);
		Captcha captcha=new Captcha(bufferedImage,new StringBuilder(code));
		return captcha;
	}
}
